package com.whz.mlc.utils;

import lombok.experimental.UtilityClass;

/**
 * @author djc
 */
@UtilityClass
public class CacheHitLevelUtils {

    private static final ThreadLocal<Integer> LEVEL = ThreadLocal.withInitial(() -> 0);

    public static void hintFir() {
        LEVEL.set(1);
    }

    public static void hintSec() {
        LEVEL.set(2);
    }

    public static void hintThird() {
        LEVEL.set(3);
    }

    public static void reset(){
        LEVEL.remove();
    }

    public static Integer getLevel(){
        return LEVEL.get();
    }
}